<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>商品列表页</title>	
	<link rel="stylesheet" href="http://localhost/Gshop/template/css/head.css" type="text/css" />
	<link rel="stylesheet" href="http://localhost/Gshop/template/css/goods_list.css" />
	<link rel="stylesheet" type="text/css" href="http://localhost/Gshop/template/css/goods_list1.css">
	<script type="text/javascript" src='http://localhost/Gshop/template/js/jquery-1.7.2.min.js'></script>
	<script type="text/javascript" src='http://localhost/Gshop/template/js/head.js'></script>
	<script type="text/javascript" src='http://localhost/Gshop/template/js/fenlei.js'></script>
</head>
<body>
<!-- 最顶部的可关闭广告 -->
<!-- <div id='top_ad'><img src="http://localhost/Gshop/template/images/top_ad.jpg" alt="" /></div> -->
<!-- 最顶部的可关闭广告结束-->
<!-- 头部灰色区域 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>京东首页</title>	
	<link rel="stylesheet" href="./css/head.css"  type="text/css" />
</head>
<body>
<!-- 最顶部的可关闭广告 -->
<!-- <div id='top_ad'><img src="./images/top_ad.jpg" alt="" /></div> -->
<!-- 最顶部的可关闭广告结束-->
<!-- 头部灰色区域 -->
	<div id="top">
		<div class="top_main">
			<!-- 左侧 -->
			<div class="top_l fl">
				<p class="didian"><span class='tu fl'></span><span class='wenzi fl'>北京</span> </p>
			</div>
			<!-- 左侧结束 -->
			<!-- 右侧 -->
			<div class="top_r fr ">
				<ul>
<!-- 头部记录用户是否已经登录开始 -->
			<?php if($_SESSION['user']){?>
					<li><span class='fl'>您好，</span>
						<span><?php echo $_SESSION['user']['uname'];?>！</span>
						<a href="<?php echo U('user/out');?>">退出</a>
					</li>
				<?php  }else{ ?>
					<li><span class='fl'>您好，欢迎来到京东！</span>
						<a href="<?php echo U('user/login',array('main'=>1));?>" class='fl'>[登录]</a> <a href="<?php echo U('user/reg',array('main'=>1));?>" class="denglu fl">[免费注册]</a> <span class='xian fl'>|</span>
					</li>
			<?php }?>
					<li><a href="<?php echo U('Member/index');?>" class="dingdan fl">我的订单</a><span class='xian fl'>|</span></li>
<!-- 头部记录用户是否已经登录结束 -->
				</ul>
			</div>
			<!-- 右侧结束 -->
		</div>
	</div>
<!-- 头部灰色区域结束 -->
<!-- 中间主体区域 -->
	



<!-- 头部灰色区域结束 -->
<!-- 中间主体区域 -->
	<div id="main">
	<!-- logo区域 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
          <script type="text/javascript" src='http://localhost/Gshop/template/js/jquery-1.7.2.min.js'></script>
         <script type="text/javascript" src='http://localhost/Gshop/template/js/jd.js'></script>
          <link rel="stylesheet" type="text/css" href="http://localhost/Gshop/template/css/logo.css">
    </head>
    <body>
<!-- logo区域开始  -->
    <div class="main_logo ">
      <img src="http://localhost/Gshop/template/images/logo.png" alt="" class="logo" />
      <div class="sousuo">
        <form action="">
          <input type="text" class="shuru fl" value='平板电脑' />
          <input type="submit" class="tijiao fr" value="搜索" />
        </form>
      </div>
      <p >
        <span class='fl'>热门搜索：</span>
<!-- 热门搜索区域开始 -->
      <?php $hd["list"]["h"]["total"]=0;if(isset($hot) && !empty($hot)):$_id_h=0;$_index_h=0;$lasth=min(1000,count($hot));
$hd["list"]["h"]["first"]=true;
$hd["list"]["h"]["last"]=false;
$_total_h=ceil($lasth/1);$hd["list"]["h"]["total"]=$_total_h;
$_data_h = array_slice($hot,0,$lasth);
if(count($_data_h)==0):echo "";
else:
foreach($_data_h as $key=>$h):
if(($_id_h)%1==0):$_id_h++;else:$_id_h++;continue;endif;
$hd["list"]["h"]["index"]=++$_index_h;
if($_index_h>=$_total_h):$hd["list"]["h"]["last"]=true;endif;?>

        <?php if($hd['list']['h']['first']){?>
          <a href="<?php echo U('category',array('cid'=>$h[cid]));?>" class="hong"><?php echo $h['cname'];?></a>
          <?php  }else{ ?>
           <a href="<?php echo U('category',array('cid'=>$h[cid]));?>"><?php echo $h['cname'];?></a>
        <?php }?>
      <?php $hd["list"]["h"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
<!-- 热门搜索区域结束 -->
      </p>

      <div class="jiesuan">
        <div class="jie_kong_da">
          <?php if(!empty($_SESSION['cart']['goods'])){?>
                <ul>
                  <?php $hd["list"]["ca"]["total"]=0;if(isset($cart) && !empty($cart)):$_id_ca=0;$_index_ca=0;$lastca=min(1000,count($cart));
$hd["list"]["ca"]["first"]=true;
$hd["list"]["ca"]["last"]=false;
$_total_ca=ceil($lastca/1);$hd["list"]["ca"]["total"]=$_total_ca;
$_data_ca = array_slice($cart,0,$lastca);
if(count($_data_ca)==0):echo "";
else:
foreach($_data_ca as $key=>$ca):
if(($_id_ca)%1==0):$_id_ca++;else:$_id_ca++;continue;endif;
$hd["list"]["ca"]["index"]=++$_index_ca;
if($_index_ca>=$_total_ca):$hd["list"]["ca"]["last"]=true;endif;?>

                  <li>
                    <div class="img"><img src="http://localhost/Gshop/<?php echo $ca['index_pic'];?>" alt=""></div>
                      <div class="name"><a href="<?php echo U('content',array('gid'=>$ca[gid]));?>"><?php echo $ca['gname'];?></a></div>
                  </li>
                <?php $hd["list"]["ca"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                </ul>
            <?php  }else{ ?>
                <span class='gou'></span>
                <span class='gouwen' >购物车中还没有商品，赶紧选购吧！</span>
          <?php }?>
        </div>
        <div class="jie">
          <a href="<?php echo U('cart/index');?>" class="fl go">去购物车结算</a><span class='youjiao fl'></span>
        </div>
      </div>   
    </div>
<!-- logo区域结束 -->
    </body>
</html>
	<!--logo区域结束  -->
	<!-- 导航区域 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
          <script type="text/javascript" src='http://localhost/Gshop/template/js/jquery-1.7.2.min.js'></script>
          <script type="text/javascript" src='http://localhost/Gshop/template/js/fenlei.js'></script>
          <script type="text/javascript" src='http://localhost/Gshop/template/js/head.js'></script>
    </head>
    <body>
<div class="menu">
      <div class="menu_l fl ">
        <a href="" class="quan_fen">全部商品分类</a>
          <!-- 左分类以及轮换图 -->
          <!-- 左侧 -->
            <div class="middle_l fl">
              <ul>
<!-- 一层栏目的循环开始 -->
              <?php $hd["list"]["cate"]["total"]=0;if(isset($categoryInfo) && !empty($categoryInfo)):$_id_cate=0;$_index_cate=0;$lastcate=min(1000,count($categoryInfo));
$hd["list"]["cate"]["first"]=true;
$hd["list"]["cate"]["last"]=false;
$_total_cate=ceil($lastcate/1);$hd["list"]["cate"]["total"]=$_total_cate;
$_data_cate = array_slice($categoryInfo,0,$lastcate);
if(count($_data_cate)==0):echo "";
else:
foreach($_data_cate as $key=>$cate):
if(($_id_cate)%1==0):$_id_cate++;else:$_id_cate++;continue;endif;
$hd["list"]["cate"]["index"]=++$_index_cate;
if($_index_cate>=$_total_cate):$hd["list"]["cate"]["last"]=true;endif;?>

                <li>
                  <div class="youkuang">
                                <div class="youkuang_l">
            <!-- 二层栏目的循环开始 -->
                                  <?php $hd["list"]["cat"]["total"]=0;if(isset($cate['_data']) && !empty($cate['_data'])):$_id_cat=0;$_index_cat=0;$lastcat=min(1000,count($cate['_data']));
$hd["list"]["cat"]["first"]=true;
$hd["list"]["cat"]["last"]=false;
$_total_cat=ceil($lastcat/1);$hd["list"]["cat"]["total"]=$_total_cat;
$_data_cat = array_slice($cate['_data'],0,$lastcat);
if(count($_data_cat)==0):echo "";
else:
foreach($_data_cat as $key=>$cat):
if(($_id_cat)%1==0):$_id_cat++;else:$_id_cat++;continue;endif;
$hd["list"]["cat"]["index"]=++$_index_cat;
if($_index_cat>=$_total_cat):$hd["list"]["cat"]["last"]=true;endif;?>

                                          <div class="youkuang_l_div">
                                                      <div class="youkuang_l_div_zi">
                                                                  <div>
                                                                    <a href=""><?php echo $cat['cname'];?></a>
                                                                  </div>
                                                        <ul>
                                                            <?php $hd["list"]["ca"]["total"]=0;if(isset($cat['_data']) && !empty($cat['_data'])):$_id_ca=0;$_index_ca=0;$lastca=min(1000,count($cat['_data']));
$hd["list"]["ca"]["first"]=true;
$hd["list"]["ca"]["last"]=false;
$_total_ca=ceil($lastca/1);$hd["list"]["ca"]["total"]=$_total_ca;
$_data_ca = array_slice($cat['_data'],0,$lastca);
if(count($_data_ca)==0):echo "";
else:
foreach($_data_ca as $key=>$ca):
if(($_id_ca)%1==0):$_id_ca++;else:$_id_ca++;continue;endif;
$hd["list"]["ca"]["index"]=++$_index_ca;
if($_index_ca>=$_total_ca):$hd["list"]["ca"]["last"]=true;endif;?>

                                                          <li><span>|</span><a href="<?php echo U('index/index/category',array('cid'=>$ca['cid']));?>"><?php echo $ca['cname'];?></a></li>
                                                            <?php $hd["list"]["cate"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
                                                        </ul>
                                                      </div>
                                          </div>

                                  <?php $hd["list"]["cat"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
            <!-- 二层栏目循环的结束 -->
                           </div>
                  </div>
                  <div class="bao">
                    <span></span>
                    <div class="kong"></div>
                    <div class="kongshang"><a href=""><?php echo $cate['cname'];?></a></div>
                  </div>
                </li>
            <?php $hd["list"]["ca"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
<!-- 一层栏目循环结束 -->
              </ul>
            </div>
          <!-- 左侧结束 -->
          <!-- 左分类以及轮换图结束-->
      </div>

      
      <div class="menu_r fl">
        <a href="http://localhost/Gshop" class="active">首页</a>
        <a href="<?php echo U('category',array('cid'=>20));?>">数码相机</a>
        <a href="<?php echo U('category',array('cid'=>44));?>">笔记本</a>
      </div>
    </div>
    </body>
</html>
	<!-- 导航区域结束 -->
	<!-- 面包屑导航 -->
	<div id="mian">
		<a href="" class="da">数码</a> > <a href="">摄影摄像</a> > <a href="">单反相机</a> > <a href="">尼康（Nikon）</a> > <a href="">尼康D3200</a>
	</div>
	<!-- 面包屑导航结束 -->
	<!-- 主体内容区域 -->
	<div id="content">
		<div class="l">
			<div class="lei">
				<ul>
					<?php $hd["list"]["brother"]["total"]=0;if(isset($brotherCategory) && !empty($brotherCategory)):$_id_brother=0;$_index_brother=0;$lastbrother=min(1000,count($brotherCategory));
$hd["list"]["brother"]["first"]=true;
$hd["list"]["brother"]["last"]=false;
$_total_brother=ceil($lastbrother/1);$hd["list"]["brother"]["total"]=$_total_brother;
$_data_brother = array_slice($brotherCategory,0,$lastbrother);
if(count($_data_brother)==0):echo "";
else:
foreach($_data_brother as $key=>$brother):
if(($_id_brother)%1==0):$_id_brother++;else:$_id_brother++;continue;endif;
$hd["list"]["brother"]["index"]=++$_index_brother;
if($_index_brother>=$_total_brother):$hd["list"]["brother"]["last"]=true;endif;?>

						<div>
							<li class="biao active">
								<!-- <span></span> -->
								<?php echo $brother['cname'];?>
							</li>
						<?php $hd["list"]["bro"]["total"]=0;if(isset($brother['childCategory']) && !empty($brother['childCategory'])):$_id_bro=0;$_index_bro=0;$lastbro=min(1000,count($brother['childCategory']));
$hd["list"]["bro"]["first"]=true;
$hd["list"]["bro"]["last"]=false;
$_total_bro=ceil($lastbro/1);$hd["list"]["bro"]["total"]=$_total_bro;
$_data_bro = array_slice($brother['childCategory'],0,$lastbro);
if(count($_data_bro)==0):echo "";
else:
foreach($_data_bro as $key=>$bro):
if(($_id_bro)%1==0):$_id_bro++;else:$_id_bro++;continue;endif;
$hd["list"]["bro"]["index"]=++$_index_bro;
if($_index_bro>=$_total_bro):$hd["list"]["bro"]["last"]=true;endif;?>

							<li class="kong">
								<a href="<?php echo U('category',array('cid'=>$bro[cid]));?>"><?php echo $bro['cname'];?></a>
							</li>
						<?php $hd["list"]["brother"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
						</div>
					<?php $hd["list"]["bro"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
				</ul>
			</div>
		</div>
		<div class="r">
		<!-- 热卖开始 -->
			<div class="remai">
				<h2 id="dong">卖家降价啦！！！亲，赶紧动起来！！</h2>
				<ul>
				    <?php $hd["list"]["like"]["total"]=0;if(isset($like_goods) && !empty($like_goods)):$_id_like=0;$_index_like=0;$lastlike=min(1000,count($like_goods));
$hd["list"]["like"]["first"]=true;
$hd["list"]["like"]["last"]=false;
$_total_like=ceil($lastlike/1);$hd["list"]["like"]["total"]=$_total_like;
$_data_like = array_slice($like_goods,0,$lastlike);
if(count($_data_like)==0):echo "";
else:
foreach($_data_like as $key=>$like):
if(($_id_like)%1==0):$_id_like++;else:$_id_like++;continue;endif;
$hd["list"]["like"]["index"]=++$_index_like;
if($_index_like>=$_total_like):$hd["list"]["like"]["last"]=true;endif;?>

					<li>
						<a href="<?php echo U('content',array('gid'=>$like[gid]));?>"><img src="http://localhost/Gshop/<?php echo $like['list_pic'];?>" alt="" /></a>
						<div class="r">
							<a href="<?php echo U('content',array('gid'=>$like[gid]));?>" class='gname'><?php echo $like['gname'];?> </a>
							<p class="tejia">特价：<span>￥<?php echo $like['price'];?></span></p>
							<p class="gou"><a href="<?php echo U('content',array('gid'=>$like[gid]));?>">立即抢购</a></p>
						</div>
					</li>
					<?php $hd["list"]["like"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
				</ul>
			</div>
		<!-- 热卖结束 -->
<!-- 让问字动起来开始 -->
<!-- 让文字动起来结束 -->

<!-- 商品的搜索属性开始 -->
		<!-- 筛选 -->
			<div class="shaixuan">
				<h2><span><?php echo $cname;?></span> - 商品筛选</h2>
				<ul>
				  <!--商品的属性开始 -->
				  <?php $hd["list"]["d"]["total"]=0;if(isset($attrClass) && !empty($attrClass)):$_id_d=0;$_index_d=0;$lastd=min(1000,count($attrClass));
$hd["list"]["d"]["first"]=true;
$hd["list"]["d"]["last"]=false;
$_total_d=ceil($lastd/1);$hd["list"]["d"]["total"]=$_total_d;
$_data_d = array_slice($attrClass,0,$lastd);
if(count($_data_d)==0):echo "";
else:
foreach($_data_d as $key=>$d):
if(($_id_d)%1==0):$_id_d++;else:$_id_d++;continue;endif;
$hd["list"]["d"]["index"]=++$_index_d;
if($_index_d>=$_total_d):$hd["list"]["d"]["last"]=true;endif;?>

					<li class="pin">
						<div class="l">
							<?php echo $d['attr_name'];?>：
						</div>
						<div class="r">
							<div class="show">
								<span><?php echo searchAttrValue(0,$hd['list']['d']['index'],'全部');?></span>
								<?php $hd["list"]["field"]["total"]=0;if(isset($d['attr']) && !empty($d['attr'])):$_id_field=0;$_index_field=0;$lastfield=min(1000,count($d['attr']));
$hd["list"]["field"]["first"]=true;
$hd["list"]["field"]["last"]=false;
$_total_field=ceil($lastfield/1);$hd["list"]["field"]["total"]=$_total_field;
$_data_field = array_slice($d['attr'],0,$lastfield);
if(count($_data_field)==0):echo "";
else:
foreach($_data_field as $key=>$field):
if(($_id_field)%1==0):$_id_field++;else:$_id_field++;continue;endif;
$hd["list"]["field"]["index"]=++$_index_field;
if($_index_field>=$_total_field):$hd["list"]["field"]["last"]=true;endif;?>

								<?php echo searchAttrValue($field['av_id'],$hd['list']['d']['index'],$field[av_name]);?>
							        	<?php $hd["list"]["d"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
							</div>
							<div class="hide" >
								<h3>
									<span>所有品牌<b></b></span>
								</h3>
								<div class="bao">
									<div class="a1 active">
										<a href="">阿玛尼（ARMANI）</a>
									</div>
									<div class="a2">
										<a href="">巴宝莉（BURBERRY）</a>
									</div>
								</div>
							</div>
						</div>
					</li>
				<?php $hd["list"]["field"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
				<!--商品的属性结束  -->
				</ul>
			</div>
		<!-- 筛选结束 -->
<!-- 商品搜索属性结束 -->
<!-- 商品区域内容的输出 -->
		<div class="zhanshi">
			<ul class='goods'>
			   <?php $hd["list"]["g"]["total"]=0;if(isset($goods) && !empty($goods)):$_id_g=0;$_index_g=0;$lastg=min(1000,count($goods));
$hd["list"]["g"]["first"]=true;
$hd["list"]["g"]["last"]=false;
$_total_g=ceil($lastg/1);$hd["list"]["g"]["total"]=$_total_g;
$_data_g = array_slice($goods,0,$lastg);
if(count($_data_g)==0):echo "";
else:
foreach($_data_g as $key=>$g):
if(($_id_g)%1==0):$_id_g++;else:$_id_g++;continue;endif;
$hd["list"]["g"]["index"]=++$_index_g;
if($_index_g>=$_total_g):$hd["list"]["g"]["last"]=true;endif;?>

				<li >
					<a href="<?php echo U('content',array('gid'=>$g['gid']));?>" class="img"><img src="http://localhost/Gshop/<?php echo $g['index_pic'];?>" alt=""  /></a>
					<span class='gname'><a href="<?php echo U('content',array('gid'=>$g['gid']));?>"><?php echo $g['gname'];?></a></span>
					<span class="description"><a href="<?php echo U('content',array('gid'=>$g['gid']));?>"><?php echo $g['description'];?> </a></span>
					<div class='bottom'>价格：￥<span><?php echo $g['price'];?></span></div>
				</li>
			<?php $hd["list"]["g"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
			</ul>
		</div>

		<div class="page"><?php echo $page;?></div>
<!-- 商品区域内容输出结束 -->
		</div>

	</div>
	<!-- 主体区域结束 -->
	
	
	<!-- 底部导航 -->
	<div class="dibu_menu">
		<a href="">关于我们</a> <a href="">联系我们</a> <a href="">人才招聘</a> <a href="">商家入驻</a><a href="">广告服务</a> <a href="">手机京东</a> <a href="">友情链接</a><a href="">销售联盟</a><a href="">京东社区</a> <a href="">京东公益</a><a href="" class="last">English Site</a>
	</div>
	<!-- 底部导航结束 -->
	<!-- icp信息 -->
	<div class="icp">
		<p>
			北京市公安局朝阳分局备案编号110105014669&nbsp;|&nbsp;京ICP证070359号&nbsp;|&nbsp;互联网药品信息服务资格证编号(京)-非经营性-2011-0034 <br />
			<a href="">音像制品经营许可证苏宿批005号</a>&nbsp;|&nbsp;出版物经营许可证编号新出发(苏)批字第N-012号&nbsp;|&nbsp;互联网出版许可证编号新出网证(京)字150号
			<br />
			<a href="">网络文化经营许可证京网文[2011]0168-061号</a>Copyright&nbsp;©&nbsp;2004-2014&nbsp;&nbsp;京东JD.com&nbsp;版权所有	
			<br />
			京东旗下网站：<a href="">360TOP</a><a href="">迷你挑</a>
		</p>
		<div class="icp_img clear">
			<a href="" class="icp_img1"><img src="http://localhost/Gshop/template/images/icp_img1.gif" alt="" /></a>
			<a href="" class="icp_img2"><img src="http://localhost/Gshop/template/images/icp_img2.gif" alt="" /></a>
			<a href="" class="icp_img3"><img src="http://localhost/Gshop/template/images/icp_img3.png" alt="" /></a>
			<a href="" class="icp_img3"><img src="http://localhost/Gshop/template/images/icp_img4.png" alt="" /></a>
		</div>

	</div>
	<!-- icp信息结束 -->
	
<!-- 中间主体区域结束 -->
</div>
</body>
</html>

